import Vue from 'vue'
import VueRouter from 'vue-router'

// 第一题：一级路由
import Home from '@/Views/Home'
import News from '@/Views/News'
import Sports from '@/Views/Sports'

//第一题：二级路由
import NewHome from '../Views/second/NewHome'
import ChinaSports from '../Views/second/ChinaSports'
import Abroad from '../Views/second/Abroad'

// 第二题:第一级
import LogOne from '../Views/LogOne'
import LogTwo from '../Views/LogTwo'
import LogThree from '../Views/LogThree'

//      二级路由
import OrderOne from '../Views/second/OrderOne'
import OrderTwo from '../Views/second/OrderTwo'
import OrderThree from '../Views/second/OrderThree'

//      第三级路由
import Blog from '../Views/pages/Blog'
import Fax from '../Views/pages/Fax'


// 面经组件
import ArticleDetail from '../Views/ArticleDetail'
import Layout from '../Views/Layout'
import Article from '../Views/Article'
import Collect from '../Views/Collect'
import Like from '../Views/Like'
import User from '../Views/User'
Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/home',
      component:Home
    },
    {
      path: '/news',
      component:News
    },
    {
      path: '/sports',
      component: Sports,
      children: [
        {
          path: 'newsports',
          component:NewHome
        },
        {
          path: 'chinasports',
          component:ChinaSports
        },
        {
          path: 'abroad',
          component:Abroad
        },
      ]
    },
    {
      path: '/logone',
      component: LogOne,
    },
    {
      path: '/logtwo',
      component: LogTwo,
      children: [
        {
          path: 'orderone',
          component:OrderOne
        },
        {
          path: 'ordertwo',
          component:OrderTwo
        },
        {
          path: 'orderthree',
          component: OrderThree,
          children: [
            {
              path: 'blog',
              component:Blog
            },
            {
              path: 'fax',
              component:Fax
            },
          ]
        }

      ]
    },
    {
      path: '/logthree',
      component: LogThree,      
    },


    //面经练习
    {
      path: '/',  //默认Layout页面
      component: Layout,
      children: [
        {
          path: '/article',
          component: Article,
        },
        {
          path: '/collect',
          component: Collect,
        },
        {
          path: '/like',
          component: Like,
        },
        {
          path: '/user',
          component: User,
        },
      ],
    },
    {
      path: '/detail/:id',//需要一个id作为参数，
      component: ArticleDetail
    }

  ]
})
export default router